package com.sumainfor.pc.market.controller.tenant;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.market.service.TenantService;
import com.sumainfor.pc.market.service.gmio.GmioTenantPactService;
import com.sumainfor.pc.market.service.tenant.impl.TenHouService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author 获取房源签署公司
 * @ClassName TenHouController
 * @date 2019/12/6 19:39
 * @description: TODO
 */
@Controller
@RequestMapping("/tenant/key/TenHou")
public class TenHouController {

     @Autowired
    TenHouService tenHouService;

     @Autowired
    GmioTenantPactService gmioTenantPactService;


     @ResponseBody
     @GetMapping("/getHouCorId")
     public JsonResult getHouCorId(@RequestParam Map<String,Object> params){
         JsonResult result = new JsonResult();
         return result.put(tenHouService.getHouCorId(params));
     }

    /**
     * 根据合同编号获取在租房间的智能设备编号
     * @param params
     * @return
     */
     @ResponseBody
     @PostMapping("/getHouRoom")
    public JsonResult getHouRoom(@RequestBody Map<String,Object> params){

         return gmioTenantPactService.getHouRoom(params);

     }


    /**
     * 根据合同编号获取在租房间的智能门锁的情况
     * @param params
     * @return
     */
    @ResponseBody
    @PostMapping("/getIntelligentRoom")
    public JsonResult getIntelligentRoom(@RequestBody Map<String,Object> params){
         JsonResult result = new JsonResult();
         return result.put(tenHouService.getIntelligentRoom(params));
     }

}
